package com.atguigu.controller;

import com.atguigu.domain.User;
import com.atguigu.feign.UserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 琉
 * @create 2021-08-12 15:16
 */
@RestController
@RequestMapping("/feign")
public class ConsumerFeignController {
    @Autowired
    private UserClient userClient;

    @RequestMapping("/{id}")
    public User queryById(@PathVariable("id")Integer id){
        return  userClient.findById(id);
    }


}
